﻿namespace IBTrader.Frontend.Trader
{
    using System;
    using System.Globalization;
    using System.Windows.Data;

    class SourceConverter : IValueConverter
    {
        public object Convert(object value, Type _, object parameter, CultureInfo __)
        {
            return value != null && value.Equals(parameter);
        }

        public object ConvertBack(object value, Type _, object parameter, CultureInfo __)
        {
            return (value is bool && (bool)value) ? parameter : null;
        }
    }
}
